package com.itheima.service;

import com.itheima.domain.Classes;
import com.itheima.mapper.OneToManyMapper;
import com.itheima.utils.MapperUtils;

import java.util.List;

public class OneToManyServiceImpl implements OneToManyService {
    @Override
    public List<Classes> selectAll() {
        try{
            OneToManyMapper oneToManyMapper = MapperUtils.getMapper(OneToManyMapper.class);
            List<Classes> classes = oneToManyMapper.selectAll();
            return classes;
        }catch(Exception e){
            e.printStackTrace();
        }finally{
            MapperUtils.close();
        }
        return null;
    }
}
